package org.kwisatz.proxybot.core;

import org.kwisatz.proxybot.FilterAdapter;
import org.kwisatz.proxybot.Message;

public class NickManager extends FilterAdapter
{	
	public String handleServerLine(String line, Message message)
	{
		if( "NICK".equals(message.getCommand() ) &&
			message.getNick().equals(context.getNickName()))
		{
			((ContextImpl)context).setNickName(message.getCmdParam());
		}

		return line;
	}
	
	public String handleClientLine(String line, Message message)
	{
		if( "NICK".equals(message.getCommand()) )
			((ContextImpl)context).setNickName(message.getCmdParam());

		return line;
	}
}
